package com.budwk.app.sys.models;

import com.budwk.starter.common.openapi.annotation.ApiModel;
import com.budwk.starter.common.openapi.annotation.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import org.nutz.json.JsonField;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 数据字典
 * @author wizzer@qq.com
 */
@Data
@Accessors(chain = true)
@Table("shequ.sys_linux_service_lay_config")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@ApiModel(description = "linux服务器配置表信息")
public class LinuxServiceLayConfig implements Serializable {

    private static final long serialVersionUID = 1210793382290366000L;
    @Column
    @Name
    @Comment("ID")
    @ApiModelProperty(description = "ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @PrevInsert(els = {@EL("snowflake()")}, nullEffective = true)
    private String id;

    @Column("ip")
    @Comment("ip地址")
    @ApiModelProperty(description = "ip地址")
    @ColDefine(type = ColType.VARCHAR, width = 100)
    private String ip;

    @Column("username")
    @Comment("用户名")
    @ApiModelProperty(description = "用户名")
    @ColDefine(type = ColType.VARCHAR, width = 100)
    private String username;

    @Column("password")
    @Comment("密码")
    @ApiModelProperty(description = "密码")
    @ColDefine(type = ColType.VARCHAR, width = 100)
    @JsonField(ignore = true)
    private String password;

    @Column("port")
    @Comment("端口号")
    @ApiModelProperty(description = "端口号")
    @ColDefine(type = ColType.INT, width = 100)
    private Integer port;

    @Column("name")
    @Comment("服务器名称")
    @ApiModelProperty(description = "服务器名称")
    @ColDefine(type = ColType.VARCHAR, width = 100)
    private String name;

    @Column("create_id")
    @Comment("操作人")
    @ApiModelProperty(description = "操作人")
    @ColDefine(type = ColType.VARCHAR, width = 100)
    private String createId;

    @Column("create_time")
    @Comment("操作时间")
    @ApiModelProperty(description = "操作时间")
    @ColDefine(type = ColType.DATETIME)
    private LocalDateTime createTime;

    @Column("type")
    @Comment("类型（1 前端  2：后端）")
    @ApiModelProperty(description = "类型")
    @ColDefine(type = ColType.VARCHAR, width = 100)
    private String type;

    @Column("file_upload_path")
    @Comment("上传到服务器存储地址路径")
    @ApiModelProperty(description = "上传到服务器存储地址路径")
    @ColDefine(type = ColType.VARCHAR, width = 200)
    private String fileUploadPath;

    @Column("remark")
    @Comment("备注")
    @ApiModelProperty(description = "备注")
    @ColDefine(type = ColType.VARCHAR, width = 200)
    private String remark;

    @Column("shell_command")
    @Comment("执行命令")
    @ApiModelProperty(description = "执行命令")
    @ColDefine(type = ColType.VARCHAR, width = 200)
    private String shellCommand;

    @Column("project_packname")
    @Comment("项目打包名称")
    @ApiModelProperty(description = "项目打包名称")
    @ColDefine(type = ColType.VARCHAR, width = 100)
    private String projectPackname;
}
